import request from '@/utils/request'

export function getTemplateContent(id) {
    return request({
        url: '/template/content/'+id,
        method: 'get'
    })
}
export function saveTemplateContent(data) {
    return request({
        url: '/template/saveContent',
        method: 'post',
        data: data,
    })
}

export function getCompanyInfo() {
    return request({
        url: '/template/companyInfo',
        method: 'get'
    })
}

export function saveCompany(data) {
    return request({
        url: '/template/saveCompany',
        method: 'post',
        data: data
    })
}

export function findList(data) {
    return request({
        url: '/template',
        method: 'get',
        params: data,
    })
}
export function findDetail(id) {
    return request({
        url: '/template/'+id,
        method: 'get'
    })
}
export function save(data) {
    if(data.id == null){
        return request({
            url: '/template',
            method: 'post',
            data: data,
        })
    }else{
        return request({
            url: '/template/'+data.id,
            method: 'put',
            data: data,
        })
    }

}
export function changeStatus(id,status) {
    return request({
        url: '/template/changeStatus/'+id+'?status='+status,
        method: 'put'
    })
}

export function deleted(id) {
    return request({
        url: '/template/'+id,
        method: 'delete',
    })
}
